
pub fn convert_base(num_str: &str, to_base: u32) -> String {
    if let Some((snum, sbase)) = num_str[..num_str.len()-1].split_once("("){
        let base = sbase.parse::<u32>().unwrap();
        let mut num = 0;
        for c in snum.to_lowercase().chars(){
            num *= base;
            num += c.to_digit(base).unwrap();
        }
        let mut res = String::new();
        loop{
            let n = num % to_base;
            res.insert(0, char::from_digit(n, to_base).unwrap());
            num /= to_base;
            if num == 0 {
                break
            }
        }
        res
    }else{
        "".to_string()
    }
}
